package collection;

import space.position.Point;

import java.util.Random;

public class GetArray {
    public static Integer[] randomIntArray(int elementNum, int start, int end) {
        Integer[] arr = new Integer[elementNum];
        Random random = new Random();
        for(int i = 0, bound = end - start; i < elementNum; i++)
            arr[i] = random.nextInt(bound) + start;
        return arr;
    }

    public static Point[] randomPointArray(int eNum, int xStart, int xEnd, int yStart, int yEnd) {
        Point[] points = new Point[eNum];
        Random random = new Random();
        int xBound = xEnd - xStart;
        int yBound = yEnd - yStart;
        for (int i = 0, x, y; i < eNum; i++) {
            x = random.nextInt(xBound) + xStart;
            y = random.nextInt(yBound) + yStart;
            points[i] = new Point(x, y);
        }
        return points;
    }
}
